package br.com.sgmf.service;

import br.com.sgmf.dao.PecaDAO;
import br.com.sgmf.model.Peca;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PecaService {

    @Autowired
    private PecaDAO pecaDAO;

    public void save(Peca peca) {
        pecaDAO.save(peca);
    }

    public void update(Peca peca) {
        pecaDAO.update(peca);
    }

    public void delete(Peca peca) {
        pecaDAO.delete(peca);
    }

    public Peca findById(Integer id) {
        return pecaDAO.findById(id);
    }

    public List<Peca> findAll() {
        return pecaDAO.findAll();
    }
}
